package Game;

import java.sql.SQLOutput;
import java.util.Arrays;
import java.util.Scanner;

/**
 * 裁判类
 */
public class Judge {
    Player player = new Player("李白");
    Computer computer = new Computer();
    /**
     * 判断玩家和电脑出拳的输赢情况
     */
    int playerInput = 0;
    int computerInput = 0;
    int playerPoint = 0;
    int computerPoint = 0;
    public void check() {
        for (int i = 0; i < 5; i++) {
            int playerInput = Player.input();
            int computerInput = Computer.guess();
            if (playerInput == computerInput) {
                System.out.println("平局");
                continue;
            }
            if ((playerInput == 1 && computerInput == 2) && (playerInput == 2 && computerInput == 3) && (playerInput == 3 && computerInput == 1)) {
                System.out.println("你赢了一局");
                player.setScore(playerPoint + 1);
            } else {
                System.out.println("你输了一局");
                computer.setScore(computerPoint + 1);
            }
            continue;
        }
            if (player.getScore() > computer.getScore()) {
                System.out.println("你的得分是" + player.getScore() + "你赢啦!" + player.getName());
            } else {
                System.out.println("你的得分是" + player.getScore() + "你输了!" + player.getName());
            }
        }
    }


